This element enables the designer to define custom structures and reuse them later in the skin code. The result is similar to the DEFINE capability but it's much more powerful since you can reinstanciante complex structures instead of just a single element with predefined values
Name | Value Type | Default Value | Description | Comment | V. |
---|---|---|---|---|---|
id |
valid element id |
empty |
id of the template. |
This is the name you will use everywhere in the skin and it will be replaced by the content of the template. |
1.3 |
default values attributes |
empty |
default values for the variables contained in the template definition. |
You can add as many attributes as you wish. |
1.3 |
First declare a template as shown here:
<TEMPLATE id="TPL_MY_TEMPLATE" attr1="x" attr2="y" ... > <!--template structure with as many elements as you whish, with implicitly declared local variables--> <ELEMENTA attribute_a="$attr1$"> <ELEMENTB attribute_c="$wxyz$"/> </ELEMENTA> </TEMPLATE>
The attributes values declared in the template definition ("attr1" and "attr2" in the example above) are default values used when these attributes are not defined in the template instanciation.
Once this template has been declared, writing the following.
<TPL_MY_TEMPLATE wxyz="hello"/>
is equivalent to writing:
<ELEMENTA attribute_a="x"> <ELEMENTB attribute_c="hello"/> </ELEMENTA>